#ifndef SCT_RTSPSERVER_TSSOURCE_H
#define SCT_RTSPSERVER_TSSOURCE_H

#include "sct/core/common.h"
#include "sct/rtspserver/streamsource.h"

#include "FramedSource.hh"

namespace sct
{
class CTsSource: public FramedSource
{
public:
	static CTsSource* createNew(UsageEnvironment& env, void* source);

private:
	CTsSource(UsageEnvironment& env, void* source);
	virtual ~CTsSource();

private:
	virtual void doGetNextFrame();
	virtual void doStopGettingFrames();

private:
	static void tryToGetNextFrame(void* p);
private:
	CStreamSource * mSource;
	double mStartReadTime;
	TaskToken mReadTask;
};
}//end namespace
#endif
